/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.wallet.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 划转记录
 *
 * @since 2022-08-16 16:13:21
 */
@Data
@TableName("transfer_record")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "划转记录")
public class TransferRecord extends Model<TransferRecord> {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long createBy;

	/**
	 * 修改人
	 */
	@ApiModelProperty(value = "修改人")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long updateBy;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 逻辑删除
	 */
	@ApiModelProperty(value = "逻辑删除")
	@TableLogic
	private String delFlag;

	/**
	 * 类型（1：资金-合约，2：合约-资金，3：已实现盈亏，4：资金费用，5：手续费，6：爆仓清算）
	 */
	@ApiModelProperty(value = "类型（1：资金-合约，2：合约-资金，3：已实现盈亏，4：资金费用，5：手续费，6：爆仓清算）")
	private String type;

	/**
	 * 币种（1：USDT）
	 */
	@ApiModelProperty(value = "币种（1：USDT）")
	private String currency;

	/**
	 * 数量
	 */
	@ApiModelProperty(value = "数量")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal quantity;

	/**
	 * 用户ID
	 */
	@ApiModelProperty(value = "用户ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long userId;

	/**
	 * 合约id
	 */
	@ApiModelProperty(value = "合约id")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long contractId;

	/**
	 * 合约名称
	 */
	@ApiModelProperty(value = "合约名称")
	private String contractName;

	/**
	 * 资金费率
	 */
	@ApiModelProperty(value = "资金费率")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal fundingRate;

}
